# 加载bazel标准库中的函数http_archive
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# 调用http_archive下载rules_go
http_archive(
    name = "io_bazel_rules_go",
    # 下面两项需要根据官方的最近版本来修改
     urls = [
         # 修改过的: sha256 = "e4d7c0277a40a7b1d6468d392a8c1b8fcbccf6fce2b69475c19fc5425b642291",
         "http://127.0.0.1:8888/rules_go/rules_go-0.18.6.tar.gz",
         # "https://moyou-jfq.oss-cn-hangzhou.aliyuncs.com/tools/bazel/rules_go/rules_go-0.18.6.tar.gz",

         # 官方: sha256 = "86ae934bd4c43b99893fc64be9d9fc684b81461581df7ea8fc291c816f5ee8c5",
         # "https://github.com/bazelbuild/rules_go/releases/download/0.18.3/rules_go-0.18.3.tar.gz"
         ],
    sha256 = "6cccc41cc8ccd72d45687fba4a923ffe62497db6d139af6fb9201aa548d30b62",
)
# 获取gazelle
http_archive(
    name = "bazel_gazelle",
     urls = [
        # "http://127.0.0.1:8888/bazel-gazelle/bazel-gazelle-0.17.0.tar.gz",
        "https://moyou-jfq.oss-cn-hangzhou.aliyuncs.com/tools/bazel/bazel-gazelle/bazel-gazelle-0.17.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz"
    ],
    sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687",
)
# 从rules_go中加载go_rules_dependencies,go_register_toolchains
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")


# 加载rules_go依赖
go_rules_dependencies()
# 加载rules_go工具
go_register_toolchains()
# 从gazelle中加载gazelle_dependencies
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies","go_repository")
# 加载gazelle依赖
gazelle_dependencies()